<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Arduino A2DP: src/BluetoothA2DPSink.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Arduino A2DP
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">BluetoothA2DPSink.h</div>  </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">// Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment">// you may not use this file except in compliance with the License.</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment">// You may obtain a copy of the License at</span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160; </div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment">//     http://www.apache.org/licenses/LICENSE-2.0</span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment">//</span></div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment">// Unless required by applicable law or agreed to in writing, software</span></div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment">// distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span></div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment">// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment">// See the License for the specific language governing permissions and</span></div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment">// limitations under the License.</span></div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="comment">//</span></div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment">// Copyright 2020 Phil Schatzmann</span></div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="comment">// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD</span></div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160; </div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="preprocessor">#ifndef __A2DP_SINK_H__</span></div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="preprocessor">#define __A2DP_SINK_H__</span></div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160; </div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="preprocessor">#ifdef __cplusplus</span></div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="keyword">extern</span> <span class="stringliteral">&quot;C&quot;</span> {</div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160; </div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<span class="preprocessor">#include &lt;stdio.h&gt;</span></div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="preprocessor">#include &lt;stdlib.h&gt;</span></div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;<span class="preprocessor">#include &lt;unistd.h&gt;</span></div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;<span class="preprocessor">#include &lt;string.h&gt;</span></div>
<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;<span class="preprocessor">#include &quot;freertos/FreeRTOS.h&quot;</span></div>
<div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;<span class="preprocessor">#include &quot;freertos/task.h&quot;</span></div>
<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;<span class="preprocessor">#include &quot;nvs.h&quot;</span></div>
<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;<span class="preprocessor">#include &quot;nvs_flash.h&quot;</span></div>
<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;<span class="preprocessor">#include &quot;esp_system.h&quot;</span></div>
<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;<span class="preprocessor">#include &quot;esp_bt.h&quot;</span></div>
<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;<span class="preprocessor">#include &quot;esp_bt_main.h&quot;</span></div>
<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;<span class="preprocessor">#include &quot;esp_bt_device.h&quot;</span></div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;<span class="preprocessor">#include &quot;esp_gap_bt_api.h&quot;</span></div>
<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;<span class="preprocessor">#include &quot;esp_a2dp_api.h&quot;</span></div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;<span class="preprocessor">#include &quot;driver/i2s.h&quot;</span></div>
<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;<span class="preprocessor">#include &quot;esp_avrc_api.h&quot;</span></div>
<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;<span class="preprocessor">#include &quot;BluetoothA2DPCommon.h&quot;</span></div>
<div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160; </div>
<div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;<span class="preprocessor">#ifdef ARDUINO_ARCH_ESP32</span></div>
<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;<span class="preprocessor">#include &quot;esp32-hal-log.h&quot;</span></div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;<span class="preprocessor">#include &quot;esp32-hal-bt.h&quot;</span></div>
<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160; </div>
<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;<span class="preprocessor">#define APP_CORE_TAG  &quot;BT_APP_CORE&quot;</span></div>
<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;<span class="preprocessor">#define APP_SIG_WORK_DISPATCH (0x01)</span></div>
<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160; </div>
<div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;<span class="preprocessor">#ifndef AUTOCONNECT_TRY_NUM</span></div>
<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;<span class="preprocessor">#define AUTOCONNECT_TRY_NUM 5</span></div>
<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160; </div>
<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160; </div>
<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;<span class="comment">/* @brief event for handler &quot;bt_av_hdl_stack_up */</span></div>
<div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;<span class="keyword">enum</span> {</div>
<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;    BT_APP_EVT_STACK_UP = 0,</div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;};</div>
<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160; </div>
<div class="line"><a name="l00062"></a><span class="lineno"><a class="line" href="class_bluetooth_a2_d_p_sink_callbacks.html">   62</a></span>&#160;<span class="keyword">class </span><a class="code" href="class_bluetooth_a2_d_p_sink_callbacks.html">BluetoothA2DPSinkCallbacks</a> {</div>
<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;  <span class="keyword">public</span>:</div>
<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;    <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="class_bluetooth_a2_d_p_sink_callbacks.html#a6044c5dc42ff6440445d10f124d11e2c">app_a2d_callback</a>(esp_a2d_cb_event_t event, esp_a2d_cb_param_t *param);</div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;    <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="class_bluetooth_a2_d_p_sink_callbacks.html#a85efda64ad1405edb8382d24770654a8">app_rc_ct_callback</a>(esp_avrc_ct_cb_event_t event, esp_avrc_ct_cb_param_t *param);</div>
<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;    <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="class_bluetooth_a2_d_p_sink_callbacks.html#a6e82c8cd94b5fe41e557d3c611fd12ec">app_task_handler</a>(<span class="keywordtype">void</span> *arg);</div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;    <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="class_bluetooth_a2_d_p_sink_callbacks.html#a9e2c4b56d94c1198b2e5650739b9be1a">audio_data_callback</a>(<span class="keyword">const</span> uint8_t *data, uint32_t len);</div>
<div class="line"><a name="l00073"></a><span class="lineno"><a class="line" href="class_bluetooth_a2_d_p_sink_callbacks.html#a301c9c34b71551fde64f3cc2fb7ce1c9">   73</a></span>&#160;    <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="class_bluetooth_a2_d_p_sink_callbacks.html#a301c9c34b71551fde64f3cc2fb7ce1c9">av_hdl_stack_evt</a>(uint16_t event, <span class="keywordtype">void</span> *p_param);</div>
<div class="line"><a name="l00075"></a><span class="lineno"><a class="line" href="class_bluetooth_a2_d_p_sink_callbacks.html#a616986984ae0d0deb7fc94f1604e17ef">   75</a></span>&#160;    <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="class_bluetooth_a2_d_p_sink_callbacks.html#a616986984ae0d0deb7fc94f1604e17ef">av_hdl_a2d_evt</a>(uint16_t event, <span class="keywordtype">void</span> *p_param);</div>
<div class="line"><a name="l00077"></a><span class="lineno"><a class="line" href="class_bluetooth_a2_d_p_sink_callbacks.html#a5562ce0b233c59b91d06bba2d894a9e2">   77</a></span>&#160;    <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="class_bluetooth_a2_d_p_sink_callbacks.html#a5562ce0b233c59b91d06bba2d894a9e2">av_hdl_avrc_evt</a>(uint16_t event, <span class="keywordtype">void</span> *p_param);</div>
<div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;};</div>
<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160; </div>
<div class="line"><a name="l00086"></a><span class="lineno"><a class="line" href="class_bluetooth_a2_d_p_sink.html">   86</a></span>&#160;<span class="keyword">class </span><a class="code" href="class_bluetooth_a2_d_p_sink.html">BluetoothA2DPSink</a> {</div>
<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;  <span class="keyword">public</span>: </div>
<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;    <a class="code" href="class_bluetooth_a2_d_p_sink.html#a2a383635d7b050833f56ee79867716bd">BluetoothA2DPSink</a>();</div>
<div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;    <a class="code" href="class_bluetooth_a2_d_p_sink.html#a0f83dea1a97baeb360e4e1221c0aeaa9">~BluetoothA2DPSink</a>();</div>
<div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_bluetooth_a2_d_p_sink.html#af7ce8131af4f085e94eb81e3fcbfc4af">set_pin_config</a>(i2s_pin_config_t pin_config);</div>
<div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;   </div>
<div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_bluetooth_a2_d_p_sink.html#ab4e52dff7ef08f17cfce4e011cdd6542">set_i2s_port</a>(i2s_port_t i2s_num);</div>
<div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;   </div>
<div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_bluetooth_a2_d_p_sink.html#a39329de792f43f90a16f9ab2ee62814f">set_i2s_config</a>(i2s_config_t i2s_config);</div>
<div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160; </div>
<div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_bluetooth_a2_d_p_sink.html#a8d6eae21dcf699b671b897f53498eaa9">start</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* name, <span class="keywordtype">bool</span> auto_reconect=<span class="keyword">true</span>);</div>
<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160; </div>
<div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_bluetooth_a2_d_p_sink.html#a5a91e49987a2e39c09fc6c2a64feaed6">end</a>(<span class="keywordtype">bool</span> release_memory=<span class="keyword">false</span>);</div>
<div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;    </div>
<div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_bluetooth_a2_d_p_sink.html#a6d068787d5fbd7a462be743bb7b8cca3">disconnect</a>();</div>
<div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160; </div>
<div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;    <span class="keyword">virtual</span> esp_a2d_audio_state_t <a class="code" href="class_bluetooth_a2_d_p_sink.html#af38d68b41544b8f0aba1bafb80f0ac75">get_audio_state</a>();</div>
<div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;   </div>
<div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;    <span class="keyword">virtual</span> esp_a2d_connection_state_t <a class="code" href="class_bluetooth_a2_d_p_sink.html#a785ef587a867d58ce31e466b1c68a96d">get_connection_state</a>();</div>
<div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160; </div>
<div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="class_bluetooth_a2_d_p_sink.html#a426488b357a83573cbcab893570700c5">isConnected</a>();</div>
<div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160; </div>
<div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;    <span class="keyword">virtual</span> esp_a2d_mct_t <a class="code" href="class_bluetooth_a2_d_p_sink.html#a77600cb1e36b7814eb9b4126cdec62d4">get_audio_type</a>();</div>
<div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160; </div>
<div class="line"><a name="l00123"></a><span class="lineno"><a class="line" href="class_bluetooth_a2_d_p_sink.html#aac9074521c80d7574a855f30b8301d13">  123</a></span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_bluetooth_a2_d_p_sink.html#aac9074521c80d7574a855f30b8301d13">set_avrc_metadata_callback</a>(<span class="keywordtype">void</span> (*callback)(uint8_t, <span class="keyword">const</span> uint8_t*)) {</div>
<div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;      this-&gt;avrc_metadata_callback = callback;</div>
<div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;    }</div>
<div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160; </div>
<div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_bluetooth_a2_d_p_sink.html#a4f94426ff4899c437d31623e013cf7a5">set_stream_reader</a>(<span class="keywordtype">void</span> (*callBack)(<span class="keyword">const</span> uint8_t*, uint32_t), <span class="keywordtype">bool</span> i2s_output=<span class="keyword">true</span>);</div>
<div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160; </div>
<div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_bluetooth_a2_d_p_sink.html#af65219e635fadbbc90f4663b33abd3e0">set_on_data_received</a>(<span class="keywordtype">void</span> (*callBack)());</div>
<div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160; </div>
<div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_bluetooth_a2_d_p_sink.html#aafd2afad1960db8ab73d7c6977aeb686">play</a>();</div>
<div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_bluetooth_a2_d_p_sink.html#aa6967e9329939596c62f16e8686cac13">pause</a>();</div>
<div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_bluetooth_a2_d_p_sink.html#a37dcbcd418b84310ccedf3330e44834f">stop</a>();</div>
<div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_bluetooth_a2_d_p_sink.html#a296fb7aaf8d8e78991d9d505353de94f">next</a>();</div>
<div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_bluetooth_a2_d_p_sink.html#a341024c18eabdb06c734c2242d5ba505">previous</a>();</div>
<div class="line"><a name="l00144"></a><span class="lineno"><a class="line" href="class_bluetooth_a2_d_p_sink.html#a624040cce89a4a2f66495f57db6c1457">  144</a></span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_bluetooth_a2_d_p_sink.html#a624040cce89a4a2f66495f57db6c1457">set_mono_downmix</a>(<span class="keywordtype">bool</span> enabled) { mono_downmix = enabled; }</div>
<div class="line"><a name="l00146"></a><span class="lineno"><a class="line" href="class_bluetooth_a2_d_p_sink.html#a9ebe4927600f29318133b5f11e0ab7f8">  146</a></span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_bluetooth_a2_d_p_sink.html#a9ebe4927600f29318133b5f11e0ab7f8">set_bits_per_sample</a>(<span class="keywordtype">int</span> bps) { i2s_config.bits_per_sample = (i2s_bits_per_sample_t) bps; }</div>
<div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;    </div>
<div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;    uint16_t <a class="code" href="class_bluetooth_a2_d_p_sink.html#a09a8b269e2a936c5517bd9f88f666a1c">sample_rate</a>();</div>
<div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160; </div>
<div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;<span class="preprocessor">#ifdef CURRENT_ESP_IDF</span></div>
<div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> set_discoverability(esp_bt_discovery_mode_t d);</div>
<div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160; </div>
<div class="line"><a name="l00157"></a><span class="lineno"><a class="line" href="class_bluetooth_a2_d_p_sink.html#a48e5a1741225334415000de607b0240c">  157</a></span>&#160;    <span class="keyword">friend</span> <a class="code" href="class_bluetooth_a2_d_p_sink.html#a48e5a1741225334415000de607b0240c">BluetoothA2DPSinkCallbacks</a>;</div>
<div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160;    </div>
<div class="line"><a name="l00159"></a><span class="lineno">  159</span>&#160;    </div>
<div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160;  <span class="keyword">protected</span>:</div>
<div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;    <span class="comment">// protected data</span></div>
<div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;    xQueueHandle app_task_queue;</div>
<div class="line"><a name="l00163"></a><span class="lineno">  163</span>&#160;    xTaskHandle app_task_handle;</div>
<div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;    i2s_config_t i2s_config;</div>
<div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;    i2s_pin_config_t pin_config;    </div>
<div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160;    <span class="keyword">const</span> <span class="keywordtype">char</span> * bt_name;</div>
<div class="line"><a name="l00167"></a><span class="lineno">  167</span>&#160;    uint32_t m_pkt_cnt = 0;</div>
<div class="line"><a name="l00168"></a><span class="lineno">  168</span>&#160;    esp_a2d_audio_state_t m_audio_state = ESP_A2D_AUDIO_STATE_STOPPED;</div>
<div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;    <span class="keyword">const</span> <span class="keywordtype">char</span> *m_a2d_conn_state_str[4] = {<span class="stringliteral">&quot;Disconnected&quot;</span>, <span class="stringliteral">&quot;Connecting&quot;</span>, <span class="stringliteral">&quot;Connected&quot;</span>, <span class="stringliteral">&quot;Disconnecting&quot;</span>};</div>
<div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160;    <span class="keyword">const</span> <span class="keywordtype">char</span> *m_a2d_audio_state_str[3] = {<span class="stringliteral">&quot;Suspended&quot;</span>, <span class="stringliteral">&quot;Stopped&quot;</span>, <span class="stringliteral">&quot;Started&quot;</span>};</div>
<div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;    esp_a2d_audio_state_t audio_state;</div>
<div class="line"><a name="l00172"></a><span class="lineno">  172</span>&#160;    esp_a2d_connection_state_t connection_state;</div>
<div class="line"><a name="l00173"></a><span class="lineno">  173</span>&#160;    esp_a2d_mct_t audio_type;</div>
<div class="line"><a name="l00174"></a><span class="lineno">  174</span>&#160;    void (*data_received)() = <span class="keyword">nullptr</span>;</div>
<div class="line"><a name="l00175"></a><span class="lineno">  175</span>&#160;    void (*stream_reader)(<span class="keyword">const</span> uint8_t*, uint32_t) = <span class="keyword">nullptr</span>;</div>
<div class="line"><a name="l00176"></a><span class="lineno">  176</span>&#160;    void (*avrc_metadata_callback)(uint8_t, <span class="keyword">const</span> uint8_t*) = <span class="keyword">nullptr</span>;</div>
<div class="line"><a name="l00177"></a><span class="lineno">  177</span>&#160;    <span class="keywordtype">bool</span> is_auto_reconnect;</div>
<div class="line"><a name="l00178"></a><span class="lineno">  178</span>&#160;    esp_bd_addr_t last_connection = {0,0,0,0,0,0};</div>
<div class="line"><a name="l00179"></a><span class="lineno">  179</span>&#160;    <span class="keywordtype">bool</span> is_i2s_output = <span class="keyword">true</span>;</div>
<div class="line"><a name="l00180"></a><span class="lineno">  180</span>&#160;    <span class="keywordtype">bool</span> player_init = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00181"></a><span class="lineno">  181</span>&#160;    <span class="keywordtype">bool</span> mono_downmix = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00182"></a><span class="lineno">  182</span>&#160;<span class="preprocessor">#ifdef CURRENT_ESP_IDF</span></div>
<div class="line"><a name="l00183"></a><span class="lineno">  183</span>&#160;    esp_bt_discovery_mode_t discoverability = ESP_BT_GENERAL_DISCOVERABLE;</div>
<div class="line"><a name="l00184"></a><span class="lineno">  184</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00185"></a><span class="lineno">  185</span>&#160; </div>
<div class="line"><a name="l00186"></a><span class="lineno">  186</span>&#160;    <span class="comment">// protected methods</span></div>
<div class="line"><a name="l00187"></a><span class="lineno">  187</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">int</span> init_bluetooth();</div>
<div class="line"><a name="l00188"></a><span class="lineno">  188</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> app_task_start_up(<span class="keywordtype">void</span>);</div>
<div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> app_task_shut_down(<span class="keywordtype">void</span>);</div>
<div class="line"><a name="l00190"></a><span class="lineno">  190</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">bool</span> app_send_msg(<a class="code" href="structapp__msg__t.html">app_msg_t</a> *msg);</div>
<div class="line"><a name="l00191"></a><span class="lineno">  191</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">bool</span> app_work_dispatch(app_callback_t p_cback, uint16_t event, <span class="keywordtype">void</span> *p_params, <span class="keywordtype">int</span> param_len);</div>
<div class="line"><a name="l00192"></a><span class="lineno">  192</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> app_work_dispatched(<a class="code" href="structapp__msg__t.html">app_msg_t</a> *msg);</div>
<div class="line"><a name="l00193"></a><span class="lineno">  193</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> app_alloc_meta_buffer(esp_avrc_ct_cb_param_t *param);</div>
<div class="line"><a name="l00194"></a><span class="lineno">  194</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> av_new_track();</div>
<div class="line"><a name="l00195"></a><span class="lineno">  195</span>&#160;<span class="preprocessor">#ifdef CURRENT_ESP_IDF</span></div>
<div class="line"><a name="l00196"></a><span class="lineno">  196</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> av_notify_evt_handler(uint8_t&amp; event_id, esp_avrc_rn_param_t&amp; event_parameter);</div>
<div class="line"><a name="l00197"></a><span class="lineno">  197</span>&#160;<span class="preprocessor">#else</span></div>
<div class="line"><a name="l00198"></a><span class="lineno">  198</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> av_notify_evt_handler(uint8_t event_id, uint32_t event_parameter);</div>
<div class="line"><a name="l00199"></a><span class="lineno">  199</span>&#160;<span class="preprocessor">#endif    </span></div>
<div class="line"><a name="l00200"></a><span class="lineno">  200</span>&#160;    </div>
<div class="line"><a name="l00201"></a><span class="lineno">  201</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> init_nvs();</div>
<div class="line"><a name="l00202"></a><span class="lineno">  202</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> get_last_connection();</div>
<div class="line"><a name="l00203"></a><span class="lineno">  203</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> set_last_connection(esp_bd_addr_t bda, <span class="keywordtype">size_t</span> size);</div>
<div class="line"><a name="l00204"></a><span class="lineno">  204</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> clean_last_connection();</div>
<div class="line"><a name="l00205"></a><span class="lineno">  205</span>&#160; </div>
<div class="line"><a name="l00206"></a><span class="lineno">  206</span>&#160;    <span class="comment">// execute AVRC command</span></div>
<div class="line"><a name="l00207"></a><span class="lineno">  207</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> execute_avrc_command(<span class="keywordtype">int</span> cmd);</div>
<div class="line"><a name="l00208"></a><span class="lineno">  208</span>&#160; </div>
<div class="line"><a name="l00212"></a><span class="lineno">  212</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_bluetooth_a2_d_p_sink.html#a32d94525aad2b16e301e15e17816d8ab">app_a2d_callback</a>(esp_a2d_cb_event_t event, esp_a2d_cb_param_t *param);</div>
<div class="line"><a name="l00213"></a><span class="lineno">  213</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> app_rc_ct_callback(esp_avrc_ct_cb_event_t event, esp_avrc_ct_cb_param_t *param);</div>
<div class="line"><a name="l00214"></a><span class="lineno">  214</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> app_task_handler(<span class="keywordtype">void</span> *arg);</div>
<div class="line"><a name="l00215"></a><span class="lineno">  215</span>&#160;    <span class="comment">// Callback for music stream </span></div>
<div class="line"><a name="l00216"></a><span class="lineno">  216</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> audio_data_callback(<span class="keyword">const</span> uint8_t *data, uint32_t len);</div>
<div class="line"><a name="l00217"></a><span class="lineno">  217</span>&#160;    <span class="comment">// av event handler</span></div>
<div class="line"><a name="l00218"></a><span class="lineno">  218</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> av_hdl_stack_evt(uint16_t event, <span class="keywordtype">void</span> *p_param);</div>
<div class="line"><a name="l00219"></a><span class="lineno">  219</span>&#160;    <span class="comment">// a2dp event handler </span></div>
<div class="line"><a name="l00220"></a><span class="lineno">  220</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> av_hdl_a2d_evt(uint16_t event, <span class="keywordtype">void</span> *p_param);</div>
<div class="line"><a name="l00221"></a><span class="lineno">  221</span>&#160;    <span class="comment">// avrc event handler </span></div>
<div class="line"><a name="l00222"></a><span class="lineno">  222</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> av_hdl_avrc_evt(uint16_t event, <span class="keywordtype">void</span> *p_param);</div>
<div class="line"><a name="l00223"></a><span class="lineno">  223</span>&#160; </div>
<div class="line"><a name="l00224"></a><span class="lineno">  224</span>&#160;    <span class="keywordtype">void</span> connect_to_last_device();</div>
<div class="line"><a name="l00225"></a><span class="lineno">  225</span>&#160;    <span class="comment">// change the scan mode</span></div>
<div class="line"><a name="l00226"></a><span class="lineno">  226</span>&#160;    <span class="keywordtype">void</span> set_scan_mode_connectable(<span class="keywordtype">bool</span> connectable);</div>
<div class="line"><a name="l00227"></a><span class="lineno">  227</span>&#160;    <span class="comment">// check if last connectioin is defined</span></div>
<div class="line"><a name="l00228"></a><span class="lineno">  228</span>&#160;    <span class="keywordtype">bool</span> has_last_connection();</div>
<div class="line"><a name="l00229"></a><span class="lineno">  229</span>&#160; </div>
<div class="line"><a name="l00230"></a><span class="lineno">  230</span>&#160;};</div>
<div class="line"><a name="l00231"></a><span class="lineno">  231</span>&#160; </div>
<div class="line"><a name="l00232"></a><span class="lineno">  232</span>&#160; </div>
<div class="line"><a name="l00233"></a><span class="lineno">  233</span>&#160;<span class="preprocessor">#ifdef __cplusplus</span></div>
<div class="line"><a name="l00234"></a><span class="lineno">  234</span>&#160;}</div>
<div class="line"><a name="l00235"></a><span class="lineno">  235</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00236"></a><span class="lineno">  236</span>&#160; </div>
<div class="line"><a name="l00237"></a><span class="lineno">  237</span>&#160; </div>
<div class="line"><a name="l00238"></a><span class="lineno">  238</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="ttc" id="aclass_bluetooth_a2_d_p_sink_callbacks_html"><div class="ttname"><a href="class_bluetooth_a2_d_p_sink_callbacks.html">BluetoothA2DPSinkCallbacks</a></div><div class="ttdoc">Public callback methods. We use a separate class so that we can protect the called methods in Bluetoo...</div><div class="ttdef"><b>Definition:</b> BluetoothA2DPSink.h:62</div></div>
<div class="ttc" id="aclass_bluetooth_a2_d_p_sink_callbacks_html_a301c9c34b71551fde64f3cc2fb7ce1c9"><div class="ttname"><a href="class_bluetooth_a2_d_p_sink_callbacks.html#a301c9c34b71551fde64f3cc2fb7ce1c9">BluetoothA2DPSinkCallbacks::av_hdl_stack_evt</a></div><div class="ttdeci">static void av_hdl_stack_evt(uint16_t event, void *p_param)</div><div class="ttdoc">av event handler</div></div>
<div class="ttc" id="aclass_bluetooth_a2_d_p_sink_callbacks_html_a5562ce0b233c59b91d06bba2d894a9e2"><div class="ttname"><a href="class_bluetooth_a2_d_p_sink_callbacks.html#a5562ce0b233c59b91d06bba2d894a9e2">BluetoothA2DPSinkCallbacks::av_hdl_avrc_evt</a></div><div class="ttdeci">static void av_hdl_avrc_evt(uint16_t event, void *p_param)</div><div class="ttdoc">avrc event handler</div></div>
<div class="ttc" id="aclass_bluetooth_a2_d_p_sink_callbacks_html_a6044c5dc42ff6440445d10f124d11e2c"><div class="ttname"><a href="class_bluetooth_a2_d_p_sink_callbacks.html#a6044c5dc42ff6440445d10f124d11e2c">BluetoothA2DPSinkCallbacks::app_a2d_callback</a></div><div class="ttdeci">static void app_a2d_callback(esp_a2d_cb_event_t event, esp_a2d_cb_param_t *param)</div><div class="ttdoc">handle esp_a2d_cb_event_t</div><div class="ttdef"><b>Definition:</b> BluetoothA2DPSink.cpp:875</div></div>
<div class="ttc" id="aclass_bluetooth_a2_d_p_sink_callbacks_html_a616986984ae0d0deb7fc94f1604e17ef"><div class="ttname"><a href="class_bluetooth_a2_d_p_sink_callbacks.html#a616986984ae0d0deb7fc94f1604e17ef">BluetoothA2DPSinkCallbacks::av_hdl_a2d_evt</a></div><div class="ttdeci">static void av_hdl_a2d_evt(uint16_t event, void *p_param)</div><div class="ttdoc">a2dp event handler</div></div>
<div class="ttc" id="aclass_bluetooth_a2_d_p_sink_callbacks_html_a6e82c8cd94b5fe41e557d3c611fd12ec"><div class="ttname"><a href="class_bluetooth_a2_d_p_sink_callbacks.html#a6e82c8cd94b5fe41e557d3c611fd12ec">BluetoothA2DPSinkCallbacks::app_task_handler</a></div><div class="ttdeci">static void app_task_handler(void *arg)</div><div class="ttdoc">task handler</div><div class="ttdef"><b>Definition:</b> BluetoothA2DPSink.cpp:863</div></div>
<div class="ttc" id="aclass_bluetooth_a2_d_p_sink_callbacks_html_a85efda64ad1405edb8382d24770654a8"><div class="ttname"><a href="class_bluetooth_a2_d_p_sink_callbacks.html#a85efda64ad1405edb8382d24770654a8">BluetoothA2DPSinkCallbacks::app_rc_ct_callback</a></div><div class="ttdeci">static void app_rc_ct_callback(esp_avrc_ct_cb_event_t event, esp_avrc_ct_cb_param_t *param)</div><div class="ttdoc">handle esp_avrc_ct_cb_event_t</div><div class="ttdef"><b>Definition:</b> BluetoothA2DPSink.cpp:881</div></div>
<div class="ttc" id="aclass_bluetooth_a2_d_p_sink_callbacks_html_a9e2c4b56d94c1198b2e5650739b9be1a"><div class="ttname"><a href="class_bluetooth_a2_d_p_sink_callbacks.html#a9e2c4b56d94c1198b2e5650739b9be1a">BluetoothA2DPSinkCallbacks::audio_data_callback</a></div><div class="ttdeci">static void audio_data_callback(const uint8_t *data, uint32_t len)</div><div class="ttdoc">Callback for music stream.</div><div class="ttdef"><b>Definition:</b> BluetoothA2DPSink.cpp:869</div></div>
<div class="ttc" id="aclass_bluetooth_a2_d_p_sink_html"><div class="ttname"><a href="class_bluetooth_a2_d_p_sink.html">BluetoothA2DPSink</a></div><div class="ttdoc">A2DP Bluethooth Sink - We initialize and start the Bluetooth A2DP Sink. The example https://github....</div><div class="ttdef"><b>Definition:</b> BluetoothA2DPSink.h:86</div></div>
<div class="ttc" id="aclass_bluetooth_a2_d_p_sink_html_a09a8b269e2a936c5517bd9f88f666a1c"><div class="ttname"><a href="class_bluetooth_a2_d_p_sink.html#a09a8b269e2a936c5517bd9f88f666a1c">BluetoothA2DPSink::sample_rate</a></div><div class="ttdeci">uint16_t sample_rate()</div><div class="ttdoc">Provides the actually set data rate (in samples per second)</div><div class="ttdef"><b>Definition:</b> BluetoothA2DPSink.cpp:517</div></div>
<div class="ttc" id="aclass_bluetooth_a2_d_p_sink_html_a0f83dea1a97baeb360e4e1221c0aeaa9"><div class="ttname"><a href="class_bluetooth_a2_d_p_sink.html#a0f83dea1a97baeb360e4e1221c0aeaa9">BluetoothA2DPSink::~BluetoothA2DPSink</a></div><div class="ttdeci">~BluetoothA2DPSink()</div><div class="ttdoc">Destructor - stops the playback and releases all resources.</div><div class="ttdef"><b>Definition:</b> BluetoothA2DPSink.cpp:64</div></div>
<div class="ttc" id="aclass_bluetooth_a2_d_p_sink_html_a296fb7aaf8d8e78991d9d505353de94f"><div class="ttname"><a href="class_bluetooth_a2_d_p_sink.html#a296fb7aaf8d8e78991d9d505353de94f">BluetoothA2DPSink::next</a></div><div class="ttdeci">virtual void next()</div><div class="ttdoc">AVRC next.</div><div class="ttdef"><b>Definition:</b> BluetoothA2DPSink.cpp:852</div></div>
<div class="ttc" id="aclass_bluetooth_a2_d_p_sink_html_a2a383635d7b050833f56ee79867716bd"><div class="ttname"><a href="class_bluetooth_a2_d_p_sink.html#a2a383635d7b050833f56ee79867716bd">BluetoothA2DPSink::BluetoothA2DPSink</a></div><div class="ttdeci">BluetoothA2DPSink()</div><div class="ttdoc">Constructor.</div><div class="ttdef"><b>Definition:</b> BluetoothA2DPSink.cpp:35</div></div>
<div class="ttc" id="aclass_bluetooth_a2_d_p_sink_html_a32d94525aad2b16e301e15e17816d8ab"><div class="ttname"><a href="class_bluetooth_a2_d_p_sink.html#a32d94525aad2b16e301e15e17816d8ab">BluetoothA2DPSink::app_a2d_callback</a></div><div class="ttdeci">virtual void app_a2d_callback(esp_a2d_cb_event_t event, esp_a2d_cb_param_t *param)</div><div class="ttdef"><b>Definition:</b> BluetoothA2DPSink.cpp:648</div></div>
<div class="ttc" id="aclass_bluetooth_a2_d_p_sink_html_a341024c18eabdb06c734c2242d5ba505"><div class="ttname"><a href="class_bluetooth_a2_d_p_sink.html#a341024c18eabdb06c734c2242d5ba505">BluetoothA2DPSink::previous</a></div><div class="ttdeci">virtual void previous()</div><div class="ttdoc">AVRC previouse.</div><div class="ttdef"><b>Definition:</b> BluetoothA2DPSink.cpp:855</div></div>
<div class="ttc" id="aclass_bluetooth_a2_d_p_sink_html_a37dcbcd418b84310ccedf3330e44834f"><div class="ttname"><a href="class_bluetooth_a2_d_p_sink.html#a37dcbcd418b84310ccedf3330e44834f">BluetoothA2DPSink::stop</a></div><div class="ttdeci">virtual void stop()</div><div class="ttdoc">AVRC stop.</div><div class="ttdef"><b>Definition:</b> BluetoothA2DPSink.cpp:848</div></div>
<div class="ttc" id="aclass_bluetooth_a2_d_p_sink_html_a39329de792f43f90a16f9ab2ee62814f"><div class="ttname"><a href="class_bluetooth_a2_d_p_sink.html#a39329de792f43f90a16f9ab2ee62814f">BluetoothA2DPSink::set_i2s_config</a></div><div class="ttdeci">virtual void set_i2s_config(i2s_config_t i2s_config)</div><div class="ttdoc">Define the i2s configuration.</div><div class="ttdef"><b>Definition:</b> BluetoothA2DPSink.cpp:147</div></div>
<div class="ttc" id="aclass_bluetooth_a2_d_p_sink_html_a426488b357a83573cbcab893570700c5"><div class="ttname"><a href="class_bluetooth_a2_d_p_sink.html#a426488b357a83573cbcab893570700c5">BluetoothA2DPSink::isConnected</a></div><div class="ttdeci">virtual bool isConnected()</div><div class="ttdoc">Returns true if the state is connected.</div><div class="ttdef"><b>Definition:</b> BluetoothA2DPSink.cpp:224</div></div>
<div class="ttc" id="aclass_bluetooth_a2_d_p_sink_html_a48e5a1741225334415000de607b0240c"><div class="ttname"><a href="class_bluetooth_a2_d_p_sink.html#a48e5a1741225334415000de607b0240c">BluetoothA2DPSink::BluetoothA2DPSinkCallbacks</a></div><div class="ttdeci">friend BluetoothA2DPSinkCallbacks</div><div class="ttdoc">Make sure that BluetoothA2DPCallbacks can call protected event handlers.</div><div class="ttdef"><b>Definition:</b> BluetoothA2DPSink.h:157</div></div>
<div class="ttc" id="aclass_bluetooth_a2_d_p_sink_html_a4f94426ff4899c437d31623e013cf7a5"><div class="ttname"><a href="class_bluetooth_a2_d_p_sink.html#a4f94426ff4899c437d31623e013cf7a5">BluetoothA2DPSink::set_stream_reader</a></div><div class="ttdeci">virtual void set_stream_reader(void(*callBack)(const uint8_t *, uint32_t), bool i2s_output=true)</div><div class="ttdoc">Define callback which is called when we receive data: This callback provides access to the data.</div><div class="ttdef"><b>Definition:</b> BluetoothA2DPSink.cpp:151</div></div>
<div class="ttc" id="aclass_bluetooth_a2_d_p_sink_html_a5a91e49987a2e39c09fc6c2a64feaed6"><div class="ttname"><a href="class_bluetooth_a2_d_p_sink.html#a5a91e49987a2e39c09fc6c2a64feaed6">BluetoothA2DPSink::end</a></div><div class="ttdeci">virtual void end(bool release_memory=false)</div><div class="ttdoc">ends the I2S bluetooth sink with the indicated name - if you release the memory a future start is not...</div><div class="ttdef"><b>Definition:</b> BluetoothA2DPSink.cpp:82</div></div>
<div class="ttc" id="aclass_bluetooth_a2_d_p_sink_html_a624040cce89a4a2f66495f57db6c1457"><div class="ttname"><a href="class_bluetooth_a2_d_p_sink.html#a624040cce89a4a2f66495f57db6c1457">BluetoothA2DPSink::set_mono_downmix</a></div><div class="ttdeci">virtual void set_mono_downmix(bool enabled)</div><div class="ttdoc">mix stereo into single mono signal</div><div class="ttdef"><b>Definition:</b> BluetoothA2DPSink.h:144</div></div>
<div class="ttc" id="aclass_bluetooth_a2_d_p_sink_html_a6d068787d5fbd7a462be743bb7b8cca3"><div class="ttname"><a href="class_bluetooth_a2_d_p_sink.html#a6d068787d5fbd7a462be743bb7b8cca3">BluetoothA2DPSink::disconnect</a></div><div class="ttdeci">virtual void disconnect()</div><div class="ttdoc">Disconnects the current a2d connection, allowing for another device to connect.</div><div class="ttdef"><b>Definition:</b> BluetoothA2DPSink.cpp:70</div></div>
<div class="ttc" id="aclass_bluetooth_a2_d_p_sink_html_a77600cb1e36b7814eb9b4126cdec62d4"><div class="ttname"><a href="class_bluetooth_a2_d_p_sink.html#a77600cb1e36b7814eb9b4126cdec62d4">BluetoothA2DPSink::get_audio_type</a></div><div class="ttdeci">virtual esp_a2d_mct_t get_audio_type()</div><div class="ttdoc">Determine the actuall audio type.</div><div class="ttdef"><b>Definition:</b> BluetoothA2DPSink.cpp:228</div></div>
<div class="ttc" id="aclass_bluetooth_a2_d_p_sink_html_a785ef587a867d58ce31e466b1c68a96d"><div class="ttname"><a href="class_bluetooth_a2_d_p_sink.html#a785ef587a867d58ce31e466b1c68a96d">BluetoothA2DPSink::get_connection_state</a></div><div class="ttdeci">virtual esp_a2d_connection_state_t get_connection_state()</div><div class="ttdoc">Determine the connection state.</div><div class="ttdef"><b>Definition:</b> BluetoothA2DPSink.cpp:220</div></div>
<div class="ttc" id="aclass_bluetooth_a2_d_p_sink_html_a8d6eae21dcf699b671b897f53498eaa9"><div class="ttname"><a href="class_bluetooth_a2_d_p_sink.html#a8d6eae21dcf699b671b897f53498eaa9">BluetoothA2DPSink::start</a></div><div class="ttdeci">virtual void start(const char *name, bool auto_reconect=true)</div><div class="ttdoc">starts the I2S bluetooth sink with the inidicated name</div><div class="ttdef"><b>Definition:</b> BluetoothA2DPSink.cpp:164</div></div>
<div class="ttc" id="aclass_bluetooth_a2_d_p_sink_html_a9ebe4927600f29318133b5f11e0ab7f8"><div class="ttname"><a href="class_bluetooth_a2_d_p_sink.html#a9ebe4927600f29318133b5f11e0ab7f8">BluetoothA2DPSink::set_bits_per_sample</a></div><div class="ttdeci">virtual void set_bits_per_sample(int bps)</div><div class="ttdoc">Defines the bits per sample for output (if &gt; 16 output will be expanded)</div><div class="ttdef"><b>Definition:</b> BluetoothA2DPSink.h:146</div></div>
<div class="ttc" id="aclass_bluetooth_a2_d_p_sink_html_aa6967e9329939596c62f16e8686cac13"><div class="ttname"><a href="class_bluetooth_a2_d_p_sink.html#aa6967e9329939596c62f16e8686cac13">BluetoothA2DPSink::pause</a></div><div class="ttdeci">virtual void pause()</div><div class="ttdoc">AVRC pause.</div><div class="ttdef"><b>Definition:</b> BluetoothA2DPSink.cpp:844</div></div>
<div class="ttc" id="aclass_bluetooth_a2_d_p_sink_html_aac9074521c80d7574a855f30b8301d13"><div class="ttname"><a href="class_bluetooth_a2_d_p_sink.html#aac9074521c80d7574a855f30b8301d13">BluetoothA2DPSink::set_avrc_metadata_callback</a></div><div class="ttdeci">virtual void set_avrc_metadata_callback(void(*callback)(uint8_t, const uint8_t *))</div><div class="ttdoc">Define a callback method which provides the meta data.</div><div class="ttdef"><b>Definition:</b> BluetoothA2DPSink.h:123</div></div>
<div class="ttc" id="aclass_bluetooth_a2_d_p_sink_html_aafd2afad1960db8ab73d7c6977aeb686"><div class="ttname"><a href="class_bluetooth_a2_d_p_sink.html#aafd2afad1960db8ab73d7c6977aeb686">BluetoothA2DPSink::play</a></div><div class="ttdeci">virtual void play()</div><div class="ttdoc">Starts to play music using AVRC.</div><div class="ttdef"><b>Definition:</b> BluetoothA2DPSink.cpp:840</div></div>
<div class="ttc" id="aclass_bluetooth_a2_d_p_sink_html_ab4e52dff7ef08f17cfce4e011cdd6542"><div class="ttname"><a href="class_bluetooth_a2_d_p_sink.html#ab4e52dff7ef08f17cfce4e011cdd6542">BluetoothA2DPSink::set_i2s_port</a></div><div class="ttdeci">virtual void set_i2s_port(i2s_port_t i2s_num)</div><div class="ttdoc">Define an alternative i2s port other then 0.</div><div class="ttdef"><b>Definition:</b> BluetoothA2DPSink.cpp:143</div></div>
<div class="ttc" id="aclass_bluetooth_a2_d_p_sink_html_af38d68b41544b8f0aba1bafb80f0ac75"><div class="ttname"><a href="class_bluetooth_a2_d_p_sink.html#af38d68b41544b8f0aba1bafb80f0ac75">BluetoothA2DPSink::get_audio_state</a></div><div class="ttdeci">virtual esp_a2d_audio_state_t get_audio_state()</div><div class="ttdoc">Determine the actual audio state.</div><div class="ttdef"><b>Definition:</b> BluetoothA2DPSink.cpp:216</div></div>
<div class="ttc" id="aclass_bluetooth_a2_d_p_sink_html_af65219e635fadbbc90f4663b33abd3e0"><div class="ttname"><a href="class_bluetooth_a2_d_p_sink.html#af65219e635fadbbc90f4663b33abd3e0">BluetoothA2DPSink::set_on_data_received</a></div><div class="ttdeci">virtual void set_on_data_received(void(*callBack)())</div><div class="ttdoc">Define callback which is called when we receive data.</div><div class="ttdef"><b>Definition:</b> BluetoothA2DPSink.cpp:156</div></div>
<div class="ttc" id="aclass_bluetooth_a2_d_p_sink_html_af7ce8131af4f085e94eb81e3fcbfc4af"><div class="ttname"><a href="class_bluetooth_a2_d_p_sink.html#af7ce8131af4f085e94eb81e3fcbfc4af">BluetoothA2DPSink::set_pin_config</a></div><div class="ttdeci">virtual void set_pin_config(i2s_pin_config_t pin_config)</div><div class="ttdoc">Define the pins.</div><div class="ttdef"><b>Definition:</b> BluetoothA2DPSink.cpp:139</div></div>
<div class="ttc" id="astructapp__msg__t_html"><div class="ttname"><a href="structapp__msg__t.html">app_msg_t</a></div><div class="ttdoc">Internal message to be sent for BluetoothA2DPSink and BluetoothA2DPSource.</div><div class="ttdef"><b>Definition:</b> BluetoothA2DPCommon.h:28</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1
</small></address>
</body>
</html>
